{extend name="index/base" /}

{block name="nav"}
<li><a href="/" class="active">首页</a></li>
<li><a href="/index.php/index/index/add">发布留言</a></li>
{/block}

{block name="title"}查看留言{/block}

{block name="main"}
    <div class="panel panel-default">
        <div class="panel-heading">{$article->title} {$article->create_time}</div>
        <div class="panel-body">
            {$article->content}
            <hr/>
            评论：
            {volist name='comments' id='c'}
            <div class="well">
                {$c.content}
                <h6> {$c.username} | 发表于 : {$c.create_time|date="Y-m-d H:i:s",###}</h6>
            </div>
            {/volist}
        </div>
    </div>
    <div class="panel panel-danger">
        <div class="panel-heading">发布评论</div>
        <div class="panel-body">
            <form method="post" action="/index.php/index/index/addcomment/id/{$article.id}">
                <div class="form-group">
                    <label>姓名：</label> <!-- for="exampleInputEmail1" -->
                    <input type="text" class="form-control" name='username' placeholder="请输入姓名">
                </div>
                <div class="form-group">
                    <label>内容：</label> <!-- for="exampleInputPassword1" -->
                    <textarea class="form-control" name="content" placeholder="请输入评论内容" rows="8"></textarea>
                </div>
                <button type="submit" class="btn btn-primary">发布评论</button>
            </form>
        </div>
    </div>
{/block}
